package com.example.javaspringweb.dao;

import com.example.javaspringweb.entity.DataDemo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DataMapper {
    @Select("SELECT * FROM testdata") //用@Select注解sql语句
    List<DataDemo> findAll();

    @Select("SELECT * FROM testdata WHERE region=#{region}")
    List<DataDemo> findRegion(@Param("region") String region);

}
